<?php
session_start();
require '../nette/Nette/loader.php';
require '../db.php';
require '../localization/lang.php';
require '../core/core.sanitizer.php';
require '../core/core.security.php';
require '../core/core.time.php';
require '../core/core.attendance.php';

$login=new core_security;
if ($login->checklogin()=="OK") {

$date=new core_time;
$date->date=$_SESSION['date2'];
$date->time="00:00";
//$timestamp=$date->totimestamp();
$timestamp=strtotime($_SESSION['date']);

$query="select * from attendance where uid=".$_SESSION['uid']." AND day=".$timestamp."";
$result=mysql_query($query);
$row=mysql_fetch_array($result);
if ($row['id'] != "") {
	echo "<span class='editattend' id='".$row['id']."'>".$date->tohm($row['att'])."</span>";
	} else {echo "<span class='editattend' id=''></span>";}
}
